<?php

class Model_Orm_Cinema extends \Orm\Model
{
        protected static $_primary_key = array('id');
	protected static $_properties = array(
                'id',
		'name',
		'address',
		'logo',
		'slogan'
	);

	protected static $_table_name = 'cinema';
        
        public static function validate($factory) {
            $val = Validation::forge($factory);

            $val->add_field('Cinema_Name', 'Nosaukums', 'required|max_length[120]|min_length[2]');
            $val->add_field('Cinema_Address', 'Adrese', 'required|max_length[200]|min_length[2]');
            $val->add_field('Cinema_Logo', 'Logo', 'max_length[50]|min_length[1]');
            $val->add_field('Cinema_Slogan', 'Sauklis', 'required|max_length[500]|min_length[1]');

            return $val;
        }

}
